Skip to content

auxjoin qparser - a prunable segment-parallel auxiliary index join - #4749

Open
mkhludnev wants to merge 63 commits into
apache:mainfrom
mkhludnev:aijoin-qparser
Open

auxjoin qparser - a prunable segment-parallel auxiliary index join#4749
mkhludnev wants to merge 63 commits into
apache:mainfrom
mkhludnev:aijoin-qparser

Conversation

@mkhludnev

@mkhludnev mkhludnev commented Aug 18, 2026

Copy link
Copy Markdown
Member

https://issues.apache.org/jira/browse/SOLR-18307

Description

Auxiliary Index Join QParserPlugin

Solution

Lazily write docvalues columns of to_docnum[from_docnum] into sidecar index.

Tests

Essential test coverage is provided.
Find benchmark (here)[https://github.com/mkhludnev/aijoin-benchmark]

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 19, 2026
@mkhludnev
mkhludnev requested a balanced review from Copilot August 19, 2026 13:52

@dsmiley dsmiley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting stuff here Mikhail!

Comment thread solr/core/src/test-files/solr/configsets/aijoin/conf/schema.xml Outdated

`auxIndexJoin` (which stands for Auxiliary Index Join) Query Parser is similar to xref:join-query-parser.adoc[], but uses a lazily written sidecar index for faster joins.

Instead of using Lucene's join utilities, the parser matches documents through a dedicated join index that is maintained alongside the core's main index.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall this index is in-memory and not on-disk. That's a key characteristic that shouldn't be omitted here. Simply insert "in-memory".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon for miscommunication. In the first version it's a plain FSDirectory.
Experiments with ByteBufferDirectory in the wait list so far.


== Segment-level Parallelism

The algorithm utilizes multiple threads on _both_ sides if multiple threads are available. So, set xref:configuration-guide:configuring-solr-xml.adoc#indexSearcherExecutorThreads[indexSearcherExecutorThreads] to `-1` or `>0` in the `solr.xml` file. Note the emphasis on _both_ above: using the xref:common-query-parameters.adoc#multithreaded-parameter[`multiThreaded`] request parameter confines the inner (`from`-side) query to a single thread, limiting performance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confuses me. Why would using multiThreaded confine the from-side to a single-thread?
Would a user ever reasonably want that? If not, it might make sense to HTTP-400

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can think of an edge case of many small segments causing many threads scheduling efforts. The current implementation is rather neat. I want to keep an option to control concurrency.

Comment thread solr/solr-ref-guide/modules/query-guide/pages/auxindexjoin-query-parser.adoc Outdated
mkhludnev and others added 3 commits September 2, 2026 20:56
Co-authored-by: David Smiley <dsmiley@apache.org>
…ry-parser.adoc

Co-authored-by: David Smiley <dsmiley@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:cloud cat:search documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants